<!-- extend from base layout -->
{% extends "base.html" %}
 
{% block content %}
	<link rel="stylesheet" type="text/css" href="http://v3.bootcss.com/examples/dashboard/dashboard.css">
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">学生上机管理系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Name</a></li>
            <li><a href="/logout">Logout</a></li>
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li><a href="/admin/stuinfo">学生管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/reservation">预约管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li class="active"><a href="/admin/computer">机器管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/statistics">上机统计</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/admin">管理员管理</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="/admin/log">显示日志</a></li>
          </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h2 class="sub-header">修改机器信息</h2>
          <form class="form-horizontal" action="/admin/computer/alter" method="POST">
            {{form.csrf_token}}
            <div class="form-group">
              <label class="col-sm-2 control-label">机器编号</label>
              <div class="col-sm-10">
                <input readonly="readonly" type="number" name="ComputerID" class="form-control" value="{{computer.ComputerID}}">
              </div>              
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">机房号</label>
              <div class="col-sm-10">
                <input required="" type="text" name="RoomID" class="form-control" value="{{computer.RoomID}}">
              </div>              
            </div>        
            <div class="form-group">
              <label class="col-sm-2 control-label">密码</label>
              <div class="col-sm-5">
                <input id="input1" type="text" name="Password" class="form-control" value="{{computer.Password}}">
              </div>  
              <div class="col-sm-5">
                <input id="input2" type="text" name="Password" class="form-control" value="{{computer.Password}}">
              </div>            
            </div> 
            <div class="form-group">
              <label class="col-sm-2 control-label">是否就绪</label>
              <div class="col-sm-10">
                <select name="isReady" class="form-control">
                {%if computer.isReady == 'Y'%}
                  <option selected value="Y">是</option>
                  <option value="N">否</option>
                {%else%}
                  <option value="Y">是</option>
                  <option selected value="N">否</option>    
                {%endif%}              
                </select>
              </div>              
            </div>  
            <div class="form-group">
              <label class="col-sm-2 control-label">是否损坏</label>
              <div class="col-sm-10">
                <select name="isBreakdown" class="form-control">
                {%if computer.isBreakdown == 'Y'%}
                  <option selected value="Y">是</option>
                  <option value="N">否</option>
                {%else%}
                  <option value="Y">是</option>
                  <option selected value="N">否</option>    
                {%endif%}              
                </select>
              </div>              
            </div> 
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-10">
                <input onclick="check()" id="submit" type="submit" class="btn btn-default" value="提交">
              </div>            
            </div>
          </form>
        </div>
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://v3.bootcss.com/dist/js/bootstrap.min.js"></script>
    <!-- Just to make our placeholder images work. Don't actually copy the next line! -->
    <script src="http://v3.bootcss.com/assets/js/vendor/holder.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="http://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script>
{% endblock %}